<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<body>
  <div class="caption" style="float: right;" onclick="triggerTab()">
    <i class="fa fa-times"></i>关闭
  </div>
  <script src="https://cdn.bootcdn.net/ajax/libs/jquery/1.9.1/jquery.js"></script>
  <script>
    function triggerTab() {
      var iframes = parent.document.getElementsByTagName("iframe");
      for(var i=0; i<iframes.length; i++){
        if(iframes[i].contentWindow === window){
          if(iframes[i].name) {
            var oAId = window.parent.document.getElementById(iframes[i].name);
            var oI = $(oAId).find('i');
            oI.trigger('click');
          }
        }
      }
    }
  </script>
</body>
</html>